package com.dq;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @ClassName Request
 * @Description request解析
 * @Author DuX1aoQiang
 * @Date 2023/5/28 17:20
 * @Version 1.0
 */
public class Request extends AbstractHttpServletRequest {
    private String method;
    private String url;
    private String protocol;
    private Socket socket;

    public Socket getSocket() {
        return socket;
    }

    public Request(StringBuilder method, StringBuilder url, StringBuilder protocol, Socket socket) {
        this.method = method.toString();
        this.url = url.toString();
        this.protocol = protocol.toString();
        this.socket = socket;
    }

    public String getMethod() {
        return method;
    }

    @Override
    public String getRequestURI() {
        return url;
    }

    public String getProtocol() {
        return protocol;
    }
}
